import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-03-14
 * Time: 19:56
 */

public class TestDemo {
    public static void main(String[] args) {
        MyQueue queue = new MyQueue();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
    }
    public static void main2(String[] args) {
        Deque<Integer> queue = new LinkedList<>();
        queue.offer(1);//默认队尾入队的
        queue.offerFirst(2);//从队头入队
        queue.offerLast(3);//从队尾入队
        System.out.println(queue.peek());
    }
    public static void main1(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.add(1);
        queue.offer(5);
        queue.offer(3);
        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.peek());
    }
}
